import pygame

class Background(pygame.Surface):
    def __init__(self, name, size):
        self.image = pygame.image.load(name)
        self.image = pygame.transform.scale(self.image, (size[0], size[1])).convert()

        x,y = self.image.get_size()
        self.image = pygame.transform.scale(self.image, (x*5, y*3)).convert()

        self.size = self.image.get_size()
        x,y = self.size
        pygame.Surface.__init__(self, (x*2, y))
        self.x = x
        self.y = y

        self.blit(self.image,(0,0))

    def draw(self, camera):
        gx, gy = camera.x, camera.y
        bg_clip_rect = pygame.rect.Rect((0, 0), self.size)
        camera.blit(self, (0,0), bg_clip_rect)
        

